'''
对获取到的内容进行标签获取时进行异常检测
'''
from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen("https://luxuewen.com/lauwen/index.html")

try:
    bsObj = BeautifulSoup(html.read(), "html.parser")
    # res = bsObj.ppewqeqw.ewewqew
    res = bsObj.p
except AttributeError as e:
    print(e)
else:
    if res == None:
        print("不能找到此标签")
    else:
        print(res)
